OBJS = ast.cmo parser.cmo scanner.cmo compile.cmo bytecode.cmo execute.cmo tbc.cmo 

LIBS=$(WITHGRAPHICS) $(WITHUNIX) $(WITHTHREADS) $(WITHSTR)

CONF=-I +threads

# Should be set to -custom if you use any of the libraries above
# or if any C code have to be linked with your program
# (irrelevant for ocamlopt)

# CUSTOM=-custom

# Default setting of the WITH* variables. Should be changed if your
# local libraries are not found by the compiler.
WITHGRAPHICS =graphics.cma -cclib -lgraphics -cclib -L/usr/X11R6/lib -cclib -lX11

WITHUNIX =unix.cma -cclib -lunix

WITHSTR =str.cma -cclib -lstr

WITHNUMS =nums.cma -cclib -lnums

WITHTHREADS =threads.cma -cclib -lthreads

WITHDBM =dbm.cma -cclib -lmldbm -cclib -lndbm

tbc : $(OBJS)
	ocamlc $(CONF) -o tbc $(LIBS) $(OBJS)

scanner.ml : scanner.mll
	ocamllex scanner.mll

parser.ml parser.mli : parser.mly
	ocamlyacc parser.mly

%.cmo : %.ml
	ocamlc $(CONF) -c $< 

%.cmi : %.mli
	ocamlc -c $<

.PHONY : clean
clean :
	rm -f tbc parser.ml parser.mli scanner.ml testall.log \
	*.cmo *.cmi *.out *.diff

# Generated by ocamldep *.ml *.mli
ast.cmo: 
ast.cmx: 
bytecode.cmo: ast.cmo 
bytecode.cmx: ast.cmx 
compile.cmo: bytecode.cmo ast.cmo
compile.cmx: bytecode.cmx ast.cmx
execute.cmo: bytecode.cmo ast.cmo 
execute.cmx: bytecode.cmx ast.cmx 
tbc.cmo: scanner.cmo parser.cmi execute.cmo \
    bytecode.cmo ast.cmo 
tbc.cmx: scanner.cmx parser.cmx execute.cmx \
    bytecode.cmx ast.cmx 
parser.cmo: ast.cmo parser.cmi 
parser.cmx: ast.cmx parser.cmi 
scanner.cmo: parser.cmi 
scanner.cmx: parser.cmx 
parser.cmi: ast.cmo 
